# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ChromeUXReport.V1.Model.QueryRequest do
  @moduledoc """
  Request payload sent by a physical web client. This request includes all necessary context to load a particular user experience record.

  ## Attributes

  *   `effectiveConnectionType` (*type:* `String.t`, *default:* `nil`) - The effective connection type is a query dimension that specifies the effective network class that the record's data should belong to. This field uses the values ["offline", "slow-2G", "2G", "3G", "4G"] as specified in: https://wicg.github.io/netinfo/#effective-connection-types Note: If no effective connection type is specified, then a special record with aggregated data over all effective connection types will be returned.
  *   `formFactor` (*type:* `String.t`, *default:* `nil`) - The form factor is a query dimension that specifies the device class that the record's data should belong to. Note: If no form factor is specified, then a special record with aggregated data over all form factors will be returned.
  *   `metrics` (*type:* `list(String.t)`, *default:* `nil`) - The metrics that should be included in the response. If none are specified then any metrics found will be returned. Allowed values: ["first_contentful_paint", "first_input_delay", "largest_contentful_paint", "cumulative_layout_shift", "experimental_time_to_first_byte", "experimental_interaction_to_next_paint"]
  *   `origin` (*type:* `String.t`, *default:* `nil`) - The url pattern "origin" refers to a url pattern that is the origin of a website. Examples: "https://example.com", "https://cloud.google.com"
  *   `url` (*type:* `String.t`, *default:* `nil`) - The url pattern "url" refers to a url pattern that is any arbitrary url. Examples: "https://example.com/", "https://cloud.google.com/why-google-cloud/"
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :effectiveConnectionType => String.t() | nil,
          :formFactor => String.t() | nil,
          :metrics => list(String.t()) | nil,
          :origin => String.t() | nil,
          :url => String.t() | nil
        }

  field(:effectiveConnectionType)
  field(:formFactor)
  field(:metrics, type: :list)
  field(:origin)
  field(:url)
end

defimpl Poison.Decoder, for: GoogleApi.ChromeUXReport.V1.Model.QueryRequest do
  def decode(value, options) do
    GoogleApi.ChromeUXReport.V1.Model.QueryRequest.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ChromeUXReport.V1.Model.QueryRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
